<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-06-17 11:05:38
 * @LastEditors: charles
 * @LastEditTime: 2021-06-17 11:10:06
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>对象简写</title>
</head>
<body>
  <script>
    let name = "terry";
    let age = 12;

    let obj1 = {
      name:"terry",
      age:12
    }

    let obj2 = {
      name:name,
      age:age
    }

    let obj3 = {
      name,
      age
    }
    console.log(obj1);
    console.log(obj2);
    console.log(obj3);
    console.log(obj1 == obj2);
    obj1.age++ ;
    console.log(obj2.age)

  </script>
</body>
</html>